package com.like.adapter;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.like.fragment.BaseFragment;
import com.like.fragment.CollectionCategoryFragment;
import com.like.fragment.CollectionListFragment;

public class CollectionAdapter extends FragmentPagerAdapter {

    private CollectionListFragment mListFragment = new CollectionListFragment();
    private CollectionCategoryFragment mCatoryFragment = new CollectionCategoryFragment();

    private BaseFragment[] fragments;

    public CollectionAdapter(FragmentManager fm){
        super(fm);
        fragments = new BaseFragment[]{mListFragment,mCatoryFragment};
    }

    @Override
    public BaseFragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }
}
